/* ============================================
   AMI - Window System (Floating Windows)
   ============================================ */

/* --- Context Window (Floating) --- */
.context-window {
    position: fixed;
    top: 60px;
    left: 40%;
    width: 600px;
    height: 450px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hex-accent);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    animation: fadeIn 0.2s ease-out;
}

.context-window.visible {
    display: flex;
}

.context-header {
    padding: 10px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.context-title {
    font-size: 13px;
    color: var(--hex-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.2s;
}

.context-close-btn:hover {
    color: white;
}

.context-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #e2e8f0;
    white-space: pre-wrap;
    line-height: 1.5;
}

.context-content::-webkit-scrollbar {
    width: 6px;
}

.context-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.context-key {
    color: #90EE90;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

/* --- User Context Editor --- */
.user-context-section {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.user-context-label {
    display: block;
    font-size: 11px;
    color: var(--hex-accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.user-context-textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 12px;
    resize: vertical;
    margin-bottom: 10px;
}

.user-context-textarea:focus {
    border-color: var(--hex-accent);
    outline: none;
}

.hex-btn-elongated {
    background: rgba(59, 130, 246, 0.1);
    border: none;
    color: var(--hex-accent);
    padding: 6px 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    transition: all 0.2s;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    position: relative;
}

.hex-btn-elongated:hover {
    background: var(--hex-accent);
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.hex-btn-elongated::before {
    content: '💾';
    font-size: 12px;
    margin-right: 5px;
}

.user-context-section::after {
    content: "";
    display: table;
    clear: both;
}

/* --- System Prompt Output --- */
.system-prompt-window {
    position: fixed;
    top: 60px;
    right: 350px;
    width: 600px;
    height: 450px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hex-accent);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    animation: fadeIn 0.2s ease-out;
}

.system-prompt-window.visible {
    display: flex !important;
    opacity: 1 !important;
}

.window-header {
    padding: 10px 15px;
    background: rgba(220, 38, 38, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.window-title {
    font-size: 13px;
    color: #f87171;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.2s;
}

.window-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #e2e8f0;
    white-space: pre-wrap;
    line-height: 1.5;
}